<script type="text/javascript">
	$(document).ready(function() {
	});

	function laporan(pageURL, title,w,h){

		var periode_awal=document.getElementById('tanggal_awal').value;

		var periode_akhir=document.getElementById('tanggal_akhir').value;

		if ((periode_awal=='')||(periode_akhir=='')){

			alert('Isilah periode awal dan akhir');

		}else{

			var left = (screen.width/2)-(w/2);

			var top = (screen.height/2)-(h/2);

			var targetWin = window.open ('<?=site_url();?>/mcm/view_lap_biaya_periode/'+periode_awal+'/'+periode_akhir, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);

			

			document.getElementById('tanggal_awal').value='';

			document.getElementById('tanggal_akhir').value='';

		}
	}

	

	$(function(){

		$("#tanggal_awal").datepicker({dateFormat: 'yy-mm-dd' });

	})	

	

	$(function(){

		$("#tanggal_akhir").datepicker({dateFormat: 'yy-mm-dd' });

	})	

	

		

	function klick_tanggal_awal(){

		var tanggal = document.getElementById("tanggal_awal");

		tanggal.focus();

	}

	

	function klick_tanggal_akhir(){

		var tanggal = document.getElementById("tanggal_akhir");

		tanggal.focus();

	}

	

	function batal(){

		document.location.href="<?=site_url();?>/mcm";

	}

	

</script>


	<?php 
		if(validation_errors())
		{
	?>
			<ul class="message error grid_12">
				<li><?=validation_errors()?></li>
				<li class="close-bt"></li>
			</ul>	
	<?php
		} 
	?>
<div id="page-heading"><h1>Verifikasi Data Mandiri Cash Management</h1></div>
<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
<tr>
	<th rowspan="3" class="sized"><img src="<?php echo base_url() ?>asset/admin/images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
	<th class="topleft"></th>
	<td id="tbl-border-top">&nbsp;</td>
	<th class="topright"></th>
	<th rowspan="3" class="sized"><img src="<?php echo base_url() ?>asset/admin/images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
</tr>
<tr>
	<td id="tbl-border-left"></td>
	<td> 
		<div id="content-table-inner">
		<table border="0" width="100%" cellpadding="0" cellspacing="0">
		
		<tr valign="top">
			<td>			
			
				<div id="step-holder">
						<div class="step-no">1</div>
						<div class="step-light-left">
							<?php 
								echo anchor('mcm/index', 'Daftar File Upload');
							?>
						</div>
						<div class="step-light-right">&nbsp;</div>
						<div class="step-no">2</div>
						<div class="step-dark-left">
							<?php 
								$now = date('m')-1;
								$now2 = '1-'.$now.'-'.date('Y');
								$now3 = '31-'.$now.'-'.date('Y');
								echo anchor('mcm/view_verifikasi', 'Daftar Data MCM');
							?>
						</div>
						<div class="step-dark-right">&nbsp;</div>
						<div class="step-no">3</div>
						<div class="step-light-left">
							<?php
								echo anchor('mcm/verifikasi', 'Ekspor Data');
							?>
						</div>
						<div class="step-light-round">&nbsp;</div>
											
						<div class="clear"></div>
					</div>
			
		 
			<br/> <br/> <br/> <br/> 
			<table border="0" cellpadding="0" cellspacing="0"  id="id-form"  >
			<?php 
			$attributes = array('name' => 'form1', 'id' => 'form1', 'class'=>'block-content form');
			echo form_open_multipart('mcm/view_verifikasi', $attributes);
			?>	 
			<tr>
				<td colspan="2">	  
				<div class="columns">
				<input type="hidden" name="id_biaya" id="id_biaya" value="<?=date('YmdHis')?>">
				<p class="colx2-left">
					<label for="complex-en-url">Periode :</label>
					<span class="relative">
						<span class="input-type-text margin-right relative">
						<input type="text" name="periode_awal" id="tanggal_awal" class="datepicker">  
						<img onclick="javascript:klick_tanggal_awal()" src="<?=base_url()?>asset/admin/images/icons/fugue/calendar-month.png" width="16" height="16">
						</span>
					</span>
					S/D
					<span class="relative">
						<span class="input-type-text margin-right relative">
						<input type="text" name="periode_akhir" id="tanggal_akhir" class="datepicker">  
						<img onclick="javascript:klick_tanggal_akhir()" src="<?=base_url()?>asset/admin/images/icons/fugue/calendar-month.png" width="16" height="16">
						</span>
					</span>
				</p>
				</div> 
				</td>
			</tr>
			<tr>			 
				<td class="noheight" colspan="2" align="right">	
					<input type="submit" value="View" class="form-submit" />
					<input type="reset" value="Batal" class="form-reset" onclick="javascript:batal();" />
				</td>	
			</tr>
			</form>
			</table> 
			
			
			<br/> <br/> 
			<hr size="2"/>
			<br/> <br/> 
			
			<?php 
				$attributes = array('name' => 'form1', 'id' => 'form1', 'class'=>'block-content form');
				echo form_open_multipart('mcm/process_update', $attributes);
			?>
			<table align="right" border="0"  cellpadding="0" cellspacing="0"   >
					<tr>
						<td align="right" colspan="7">
							<input type="submit" value="Simpan" class="form-submit" />
							<input type="reset" value="Batal" class="form-reset" onclick="javascript:batal();" />
						</td>
					</tr>
			</table>
			<br/><br/>
			<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">	
				<thead>
					<tr>										
						<th class="table-header-repeat line-left minwidth-0" width="10px"><a href="">Nomor</a></th> 
						<th class="table-header-repeat line-left minwidth-1"><a href="">Tanggal</a></th>				 				
						<th class="table-header-repeat line-left minwidth-1"><a href="">Rincian Transaksi</a></th>	
						<th class="table-header-repeat line-left minwidth-1"><a href="">Uraian</a></th>  
						<th class="table-header-repeat line-left minwidth-1"><a href="">Nilai</a></th>		 
						<th class="table-header-repeat line-left minwidth-1"><a href="">Parawaba</a></th>		
						<th class="table-header-repeat line-left minwidth-1"><a href="">Kategori</a></th>
						<th class="table-header-repeat line-left minwidth-1"><a href="">Status</a></th>						
					</tr>
				</thead>
				<tbody>
				 <? echo "<input type='hidden' name='count_result'  id='count_result' value='".$count_result ."'>"?> 
				<?php 
				$i=0;
				foreach($results->result() as $row) 
				{
				$i=$i+1;
				?>
					<tr class="alternate-row">
						<td align="left" valign="top">
							<?=$i?> 
							<? echo "<input type='hidden' name='id".$i."'  id='id".$i."' value='".$row->id ."'>"?>  
							<? echo "<input type='hidden' name='id_mcm".$i."'  id='id_mcm".$i."' value='".$row->id_mcm ."'>"?>
						</td>
						<td align="left" valign="top">
							 <?php
								$array_hari = array(1=>"Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu", "Minggu");
								$hari = $array_hari[date("N")];
								$this->load->library('Lib_date');
								$sekarang = $this->lib_date->mysql_to_human(date("Y-m-d"));
								$tgl1= $this->lib_date->mysql_to_human($row->tanggal);  
								$tgl2= $this->lib_date->get_day($row->tanggal);  
							?> 
							<?=$tgl1?> 
							<? echo "<input type='hidden' name='tanggal".$i."'  id='tanggal".$i."' value='".$row->tanggal ."'>"?>
						</td>
						<td align="left" valign="top">
							<?=$row->rincian_transaksi?>  
							<? //echo "<input type='hidden'   name='rincian_transaksi".$i."'  id='rincian_transaksi".$i."' value='".$row->rincian_transaksi."'>"?>
						</td> 
						<td align="left" valign="top">
							<?//=$row->uraian?>  
							<? echo "<textarea  cols='25' rows='3' name='uraian".$i."'  id='uraian".$i."' >".$row->uraian ."</textarea>"?>
						</td> 
						<td align="left" valign="top">
							<?//=convert_rupiah_non_rp($row->kredit)?> 
							<? echo "<input type='text' style='text-align:right' name='kredit".$i."'  id='kredit".$i."' value='".convert_rupiah_non_rp($row->kredit) ."'"?> <? if($row->status == 'posting'){ echo "disabled='disabled' >"; }?>
						</td> 
						<td align="left" valign="top">
							<select <? echo " name='parawaba".$i."' id='parawaba".$i."' "?> <? if($row->status == 'posting'){ echo "disabled='disabled'"; } ?>>
								<option value=''>--Pilih Parawaba--</option>
									<?php
										//mysql_connect("localhost","root","");
										//mysql_select_db("dbajax");
										//tampilkan nama-nama propinsi yang ada di database
										$sql = mysql_query("SELECT * FROM master_parawaba ORDER BY nama ASC");
										while($p=mysql_fetch_array($sql)){
										$sel = ($p['id'] == $row->parawaba)? "selected" : "";
										echo "<option value=\"".$p['id']."\" $sel>".$p['nama']."</option>";
										}
									?>
									<?php
									/*
										foreach($parawaba->result() as $parawaba) 
										{
											$sel = ($parawaba->id == $row->parawaba)? "selected" : "";
											echo "<option value=\"".$parawaba->id."\" $sel>".$parawaba->nama."</option>";
										}
									*/
									?>
							</select>
							<?//=$row->parawaba?> 
						</td> 
						<td align="left" valign="top">
							<select <? echo " name='kategori".$i."' id='kategori".$i."' "?> <? if($row->status == 'posting'){ echo "disabled='disabled'"; } ?>>
								<option  value=''>--Pilih Kategori--</option>
									<?php
										//mysql_connect("localhost","root","");
										//mysql_select_db("dbajax");
										//tampilkan nama-nama propinsi yang ada di database
										$sql = mysql_query("SELECT * FROM master_kategori ORDER BY id ASC");
										while($p=mysql_fetch_array($sql)){
										$sel = ($p['id'] == $row->kategori)? "selected" : "";
										echo "<option value=\"".$p['id']."\" $sel>".$p['nama']."</option>";
										}
									?>
									<?php
									/*
										foreach($kategori->result() as $kategori) 
										{
											$sel = ($kategori->id == $row->kategori)? "selected" : "";
											echo "<option value=\"".$kategori->id."\" $sel>".$kategori->nama."</option>";
										}
									*/
									?>
							</select>
							<?//=$row->kategori?> 
						</td> 
						<td align="left" valign="top">
							 
							<?=$row->status?> 
						</td> 
					</tr>
				<?php } ?>	
				</tbody> 
				</table> 
				<table align="right" border="0"  cellpadding="0" cellspacing="0"   >
					<tr>
						<td align="right" colspan="7">
							<input type="submit" value="Simpan" class="form-submit" />
							<input type="reset" value="Batal" class="form-reset" onclick="javascript:batal();" />
						</td>
					</tr>
				</table>
				</form>		
		</div>
		</td>
		</tr> 		 
	</div> 
	</td>
</tr>
</table>

<div class="clear"></div>
 

</div>	
</td>
<td id="tbl-border-right"></td>
</tr>
<tr>
	<th class="sized bottomleft"></th>
	<td id="tbl-border-bottom">&nbsp;</td>
	<th class="sized bottomright"></th>
</tr>
</table>
 


			